package com.atomikos.service.impl;

import com.atomikos.annotation.DataSource;
import com.atomikos.dao.UserDao2;
import com.atomikos.entity.UserEntity;
import com.atomikos.service.AddUserTwoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@DataSource(name="db2")
public class AddUserTwoImpl extends ServiceImpl<UserDao2, UserEntity> implements AddUserTwoService {


    @Override
    @Transactional
    public void saveTwo(UserEntity userBakEntity) {
        save(userBakEntity);
    }

    @Override
    public List<UserEntity> queryList() {
        return list();
    }
}
